<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="__PUBLIC__/Admin/css/index.css"/>
	</head>

	<body>
		<a href="{:U('add')}">ADD</a>
		<table>
			<thead>
				<tr>
					<th>ID</th>
					<th>Name</th>
					<th>Pid</th>
					<th>Path</th>
					<th>子类</th>
					<th>操作</th>
					<th>操作</th>
				</tr>
			</thead>

			<tbody>
				<volist name="data" id="row">
					<tr>
						<td>{$row["id"]}</td>
						<?php
							$arr = explode(",", $row["path"]);
							array_pop($arr);
							$size = count($arr);
						?>
						<td>{:str_repeat("|-", $size - 1)}{$row["name"]}</td>
						<td>{$row["pid"]}</td>
						<td>{$row["path"]}</td>
						<if condition="$size eq 3">
							<td>X</td>
							<else />
							<td>
								<a href="{:U('add',array('pid'=>$row['id'],'path'=>$row['path'].$row['id'].','))}">添加</a>
							</td>
						</if>
						<td>
							<a href="{:U('edit',array('id'=>$row['id']))}">修改</a>
						</td>
						<td>
							<a href="{:U('delete',array('id'=>$row['id']))}">删除</a>
						</td>
					</tr>
				</volist>
			</tbody>

		</table>
	</body>

</html>